package demon1;

public class Sort {
    //插入排序
    public void insertSort(int[] arr){
        for (int i = 1; i < arr.length; i++) {
            int j=i-1;
            int temp=arr[i];
            for (; j >0 ; j--) {
                if(arr[j]>temp){
                    arr[j+1]=arr[j];
                }else {
                    break;
                }
            }
            arr[j+1]=temp;
        }
    }
    public void swap(int[] arr,int i,int j){
        int tmp=arr[i];
        arr[i]=arr[j];
        arr[j]=tmp;
    }

    //希尔排序
    public void shellSort(int[] arr){
        int gap=arr.length;
        while(gap>1){
            gap=gap/2;
            shell(arr,gap);
        }
    }
    public void shell(int[] arr,int gap){
        for (int i = gap; i <arr.length ; i++) {
            int temp=arr[gap];
            int j=i-gap;
            for (; j < ; j++) {

            }
        }
    }
}
